package com.entities.userrole.actionscript;

import com.core.ui.actionscript.ActionScriptParser;
import com.core.utils.GlobalConstants;

public class ActionScriptParserRoleOpen
        extends ActionScriptParser {

	private String roleId = null;



	public void setRoleId ( String value ) {

		roleId = value;
	}



	public String entityIdentifierName () {

		return "id";
	}



	public String parseActionScriptParam ( com.model.KeyValue scriptParam ) {

		String result = null;
		if ( GlobalConstants.ACTIONSCRIPT_USERINFO_PARAM_KEY.equalsIgnoreCase(scriptParam.getUserInfo()) ) {
			result = String.format("id=%s", this.roleId);
		} else if ( GlobalConstants.ACTIONSCRIPT_USERINFO_PARAM_FORM.equalsIgnoreCase(scriptParam.getKey()) ) {
			result = "EditForm";

		} else {
			result = scriptParam.getValue();
		}
		return result;
	}

}
